package com.example.seataBusiness.feign;

import com.example.seataBusiness.common.response.ObjectResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestParam;

@FeignClient(name = "seata-account")
public interface AccountServiceFeignClient {

    /**
     * 扣减账户服务接口
     *
     * @param userId     用户ID
     * @param orderMoney 订单总金额
     */
    @PostMapping("/account")
    ObjectResponse<Object> decreaseAccount(@RequestParam("userId") String userId,
                                   @RequestParam("orderMoney") double orderMoney);
}
